/**
 * Copyright (c) 2018, wuyy All rights reserved.
 * wuyy 专有/保密源代码,未经许可禁止任何人通过任何渠道使用、修改源代码.
 * QQ:16349023
 * 项目名称 : com.wy2.eclipse.tool.ui
 * @version V1.0
 */
package com.wy2.eclipse.tool.ui.menuadapter;

import org.eclipse.core.resources.IProject;
import org.eclipse.jdt.core.IJavaProject;

/**
 * @author wuyy<16349023@qq.com>
 * @date 2018年1月17日上午11:43:19
 * 
 */
public class ProjectAdapter  {

    private final Object adaptableObject;

    public ProjectAdapter(Object adaptableObject) {
        super();
        this.adaptableObject = adaptableObject;
    }

    public IProject getProject() {
    	if(adaptableObject instanceof IProject) {
            IProject project = (IProject) adaptableObject;   
            return project;
            
        }else if(adaptableObject instanceof IJavaProject) {
        	IJavaProject javaProject=(IJavaProject)adaptableObject;
        	return javaProject.getProject();
        }
    	return null;
    }   
    

}
